package com.tbynet.jwp.framework.core;

// 创建配置常量类
public final class JwpConstants {
    private JwpConstants() {}

    // 项目配置
    public static final String PROJECT_NAME = "JWP";
    public static final String VERSION = "3.0.0";

    // 响应码
    public static final String CODE_SUCCESS = "SUCCESS";
    public static final String CODE_ERROR = "ERROR";
    public static final String CODE_BUSINESS_ERROR = "BUSINESS_ERROR";

    // 缓存相关
    public static final String CACHE_USER = "user_cache";
    public static final String CACHE_PERMISSION = "permission_cache";
    public static final long CACHE_DEFAULT_EXPIRE = 3600; // 1小时

    // 批量操作批次大小，避免单次操作数据量过大导致性能问题
    public static final int MAX_BATCH_OPERATION_SIZE = 100;

    // 分页相关
    public static final int DEFAULT_PAGE_SIZE = 20;
    public static final int MAX_PAGE_SIZE = 100;

    // 安全相关
    public static final int PASSWORD_MIN_LENGTH = 6;
    public static final int PASSWORD_MAX_LENGTH = 20;

    // 性能监控
    public static final long SLOW_SQL_THRESHOLD = 1000; // 1秒
    public static final long SLOW_METHOD_THRESHOLD = 500; // 500毫秒 慢方法执行阈值（毫秒）- 超过此时间记录警告日志

    /** 异步任务超时时间（秒）- 防止异步任务无限等待 */
    public static final long ASYNC_TASK_TIMEOUT = 30;

    // 错误码
    public static final String ERROR_CODE_PARAM = "PARAM_ERROR";
    public static final String ERROR_CODE_BUSINESS = "BUSINESS_ERROR";
    public static final String ERROR_CODE_SYSTEM = "SYSTEM_ERROR";
}